<template lang="jade">
div.return-bar(@click="back()")
  i.iconfont &#xe668;
  div.limitedname {{ obj.name }} 评估报告
  
div.detail-info
  div
    header 抵押物信息
    article.content
      div 项目名称：{{ obj.name }}
      div 评估总价：{{ obj.loan_max }} 万元
      div 评估单价：{{ obj.assess_price }} 万元/㎡
      div 借款金额：{{ obj.price }}万元
      div 抵押率：{{ obj.loan_rate }}%

    header 相关图片
    article.content
      div.pic
        div.img(style="background: url({{obj.property_guise}}) no-repeat center center;background-size:cover;")
          a(href="{{obj.property_guise}}",target="_blank")
          span 小区实景图

        div.img(style="background: url({{obj.traffic_map}}) no-repeat center center;background-size:cover;")
          a(href="{{obj.traffic_map}}",target="_blank")
          span 地理位置图

    header 周边配套
    article.content
      div 商业：{{ obj.around_business }}
      div 学校：{{ obj.around_school }}
      div 医院：{{ obj.around_hospital }}
      div 休闲：{{ obj.entertainment }}

    header 价值分析
    article.content
      a(href="{{obj.trend}}",target="_blank")
        img(src="{{obj.trend}}")


    header 评估专员总结
    article.content.assessment
      p(v-bind:class="{ 'has-read': !showReportFlag }") {{ obj.assess_analyze }}
      div.readmore(v-if="showReportFlag",v-on:click="showReport")
        i.iconfont &#xe649;
        span 查看全部

    header 评估报告
    article.content
      ul.clearfix.report
        li(v-for="(index, item) in other_list")
          a(v-on:click="changeReport(item.apply_id)")
            span {{ item.house_name }}
            em {{ item.initial_assess_time }}

</template>

<script>
import '../../assets/sass/invest/invest.scss'
//import '../../assets/sass/detail/report.scss'
import {Api_Report} from '../../config/api'

export default {

  data () {
    return {
      obj: {},
      other_list: {},
      showReportFlag: true,
      wx_share:{"title":'', "link":window.location.href, "img":'http://www.uximoney.com/themes/blue/img/logo-temp.png', "desc":''}
    }
  },
  methods: {
    back(){
      //this.$route.router.go('/auto-buy')
      window.history.back();
    },
    changeReport: function (key) {
      this.itemId = key
      this.fetch()
      document.body.scrollTop =0
    },
    showReport: function () {
      this.showReportFlag = false;
    },

    fetch: function () {
      this.$http({url: Api_Report+'&apply_id='+this.itemId, method: 'GET'}).then(function (response) {
        this.obj = response.data.data;
        this.other_list = response.data.list
        document.title = this.obj.name + " 项目评估报告 有喜财富手机版" ;

        //微信分享
        this.wx_share.desc = "有喜财富评估报告";
        this.wx_share.title = this.obj.name + " 项目评估报告";
        this.wx_share.img = this.obj.property_guise;
        this.global.wxset(this.wx_share)


      });
    }

  },
  route: {
    activate ( transition ) {
      this.itemId = transition.to.params.reportId;
      this.fetch()
      transition.next();
    }
  }
}
</script>
